//对应的是demo.js
//导入
// import * as mm from "./demo.js"
// // console.log(mm.func());
// console.log(mm.default.xx);
// console.log(mm.default.yy());


//import {str, func} from "./demo.js"
//import {func} from "./demo.js"
//import {func as yy} from "./demo.js"
//console.log(yy());

// import {default as ss} from './demo.js'
// console.log(ss.yy());

// import {default as ss} from './demo.js'
// console.log(ss.yy());

// let x = 200;
// if (x === 100) {
//     import('./demo.js').then(module => {
//         console.log(module.default.yy());
//     });
// }



// express简易后台搭建

//引入模块
const express = require('express');
//创建应用对象
const app = express();
//创建路由规则
app.all('/register', (request, response)=>{
    console.log(request.url);
    //设置响应
    response.setHeader('Access-Controll-Allow-Origin', '*'); //允许跨域请求
    response.send('register success');
});
app.all('/', (request, response)=>{
    console.log(request);
    //设置响应
    response.setHeader('Access-Controll-Allow-Origin', '*'); //允许跨域请求
    response.send('register success /');
});
//监听端口，启动服务
app.listen(8080, ()=>{
    console.log('后台启动完毕，监听在8080端口');
});





